package com.hjm.system.manage;

import com.hjm.common.core.constants.CacheConstants;
import com.hjm.redis.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class QuestionCacheManager {

    @Autowired
    private RedisService redisService;

    // todo  ： redis 缓存的更新

    public void addCache(Long questionId){
        redisService.leftPushForList(CacheConstants.QUESTION_LIST,questionId);

    }

    public void deleteCache(Long questionId){
        redisService.removeForList(CacheConstants.QUESTION_LIST,questionId);

    }

}

